<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<title>安装质量报告内容</title>
		<!-- css代码 start -->
		<link href="../../../../css/mui.min.css" rel="stylesheet" />
		<link href="../../../../css/global.css" rel="stylesheet" />
		<link href="../../../../css/style.css" rel="stylesheet" />
		<link href="../../../../css/checkbox.css" rel="stylesheet" />
		<style>
			.mui-checkbox input[type=checkbox], .mui-radio input[type=radio]{
				top: 8px;
				right: -10px;
			}
			.item_box .item .text{
				display: flex;
				height: auto;
				min-height: 30px;
			}
			.item_box .item .text span.l{
				width: auto;
				height: auto;
			}
			.item_box .item .text span.cen{
				margin-left: 0;
				flex: 1;
			}
		</style>
		<!-- css代码 end -->
	</head>
	<body>
		
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 id="title" class="mui-title">质量及安装报告</h1>
		</header>
		<div class="mui-content">
			<div class="page_cen shadow title_num">服务编号：<span class="fr">{{service_no}}</span></div>
			<div class="page_cen shadow">
				<p class="bg_title">用户联系人信息</p>
				<div class="details_con mt0">
					<div class="clum mr">
						<span class="name">主要联系人</span>
						<span class="txt">{{primary_contact}}</span>
					</div>
					<div class="clum mr">
						<span class="name">电子邮件地址1</span>
						<span class="txt">{{email_address1}}</span>
					</div>
					<div class="clum mr">
						<span class="name">电子邮件地址2</span>
						<span class="txt">{{emai_address2}}</span>
					</div>
					<div class="clum mr">
						<span class="name">电话</span>
						<span class="txt">{{phone_number}}</span>
					</div>
					<div class="clum mr">
						<span class="name">传真</span>
						<span class="txt">{{fax_number}}</span>
					</div>
					<div class="clum mr">
						<span class="name">职位</span>
						<span class="txt">{{Position}}</span>
					</div>
				</div>
			</div>
			<div class="page_cen shadow">
				<p class="bg_title">仪器详细信息</p>
				<div class="details_con mt0">
					<div class="clum mr autoHeight">
						<span class="name">仪器型号</span>
						<span class="txt wid">{{equipment_model}}</span>
					</div>
					<div class="clum mr">
						<span class="name">序列号</span>
						<span class="txt">{{serial_number}}</span>
					</div>
					<div class="clum mr">
						<span class="name">用户号</span>
						<span class="txt">{{USER_ID}}</span>
					</div>
					<div class="clum mr">
						<span class="name">销售订单号</span>
						<span class="txt">{{Sales_order_number}}</span>
					</div>
					<div class="clum mr">
						<span class="name">原产工厂</span>
						<span class="txt">{{factory_origin}}</span>
					</div>
					<div class="clum mr">
						<span class="name">仪器应用领域</span>
						<span class="txt">{{equipment_territory}}</span>
					</div>
				</div>
			</div>
			
			<!--<div class="page_cen shadow">
				<p class="bg_title nobor">备件信息</p>
			</div>-->
			
			<div class="page_cen shadow">
				<p class="bg_title">其他设备信息</p>
				<div class="details_con mt0">
					<div class="clum mr autoHeight">
						<span class="name">设备类型1</span>
						<span class="txt">{{equipment_type1}}</span>
					</div>
					<div class="clum mr">
						<span class="name">序列号1</span>
						<span class="txt">{{serial_number1}}</span>
					</div>
					<div class="clum mr autoHeight">
						<span class="name">设备类型2</span>
						<span class="txt">{{equipment_type2}}</span>
					</div>
					<div class="clum mr">
						<span class="name">序列号2</span>
						<span class="txt">{{serial_number2}}</span>
					</div>
					<div class="clum mr autoHeight">
						<span class="name">设备类型3</span>
						<span class="txt">{{equipment_type3}}</span>
					</div>
					<div class="clum mr">
						<span class="name">序列号3</span>
						<span class="txt">{{serial_number3}}</span>
					</div>
				</div>
			</div>
			
			<div class="page_cen shadow">
				<p class="bg_title">计算机和软件信息</p>
				<div class="details_con mt0">
					<div class="clum mr autoHeight">
						<span class="name">电脑厂家</span>
						<span class="txt">{{computer_Mfr}}</span>
					</div>
					<div class="clum mr">
						<span class="name">序列号</span>
						<span class="txt">{{serial_number}}</span>
					</div>
					<div class="clum mr">
						<span class="name">型号</span>
						<span class="txt">{{model_number}}</span>
					</div>
					<div class="clum mr">
						<span class="name">系统软件</span>
						<span class="txt">{{system_software}}</span>
					</div>
					<div class="clum mr">
						<span class="name">操作软件</span>
						<span class="txt">{{software}}</span>
					</div>
					<div class="clum mr">
						<span class="name">选项软件</span>
						<span class="txt">{{option_software}}</span>
					</div>
				</div>
			</div>
			
			<div class="page_cen shadow">
				<p class="bg_title">安装工程师的信息</p>
				<div class="details_con mt0">
					<div class="clum mr autoHeight">
						<span class="name">工程师姓名</span>
						<span class="txt">{{enginner_name}}</span>
					</div>
					<div class="clum mr">
						<span class="name">安装起始时间</span>
						<span class="txt">{{install_start_time}}</span>
					</div>
					<div class="clum mr">
						<span class="name">安装截止时间</span>
						<span class="txt">{{install_end_time}}</span>
					</div>
				</div>
			</div>
			
			<div class="page_cen shadow">
				<p class="bg_title">保修信息</p>
				<div class="details_con mt0">
					<div class="clum mr autoHeight">
						<span class="name">保修起始时间</span>
						<span class="txt">{{warranty_start_time}}</span>
					</div>
					<div class="clum mr">
						<span class="name">保修截止时间</span>
						<span class="txt">{{warranty_end_time}}</span>
					</div>
					<!-- <div class="clum mr">
						<span class="name">保修延长时间</span>
						<span class="txt">？？？</span>
					</div>
					<div class="clum mr">
						<span class="name">保修延长期说明</span>
						<span class="txt">？？？</span>
					</div> -->
				</div>
			</div>
			
			<div class="page_cen shadow">
				<p class="bg_title">系统质量：维修工程师评估</p>
				<div class="details_con mt0">
					<div class="clum mr autoHeight">
						<span class="name">到货完整</span>
						<span class="txt">{{Is_arrival_complete}}</span>
					</div>
					<div class="clum mr">
						<span class="name">系统质量如何</span>
						<span class="txt">{{system_quality}}</span>
					</div>
				</div>
			</div>
			
			<div class="page_cen shadow">
				<p class="bg_title nobor">工时信息</p>
				<div class="item_box mt0">
					<div class="item mr">
						<div class="bg_th">
							<p>活动类型</p>
							<p>小时</p>
							<p>描述</p>
						</div>
						<div class="bg_td">
							<p>工作</p>
							<p>{{work_time}}</p>
							<p>安装工时</p>
						</div>
						<div class="bg_td">
							<p>旅途</p>
							<p>{{trip_time}}</p>
							<p>旅途工时</p>
						</div>
						<div class="bg_td">
							<p>浪费</p>
							<p>{{waste_time}}</p>
							<p>浪费工时</p>
						</div>
						<div class="bg_td">
							<p>加班</p>
							<p>{{work_overtime}}</p>
							<p>加班工时</p>
						</div>
					</div>
				</div>
				
			</div>
			<div class="page_cen shadow" v-show="isShowInstrumentAsset">
				<p class="bg_title nobor">仪器附属设备信息</p>
				<div class="item_box mt0">
					<div class="item mr" v-for="item in instrumentAssets">
						<div class="bar">
							<span class="number">{{item.ASSET_NO}}<img src="../../../../images/icon_204.png" /></span>
						</div>
						<div class="text">
							<span class="l">附属设备名称：</span>
							<span class="cen">{{item.ASSET_NAME}}</span> 
						</div>
						<div class="text">
							<span class="l">序列号：</span>
							<span class="cen">{{item.ASSET_SN}}</span> 
						</div>
						<div class="type">
							<p>保修开始时间：<span>{{item.Asset_WarrantyStart}}</span><img src="../../../../images/icon_202.png"/></p>
							<p>保修结束时间：<span>{{item.Asset_WarrantyEnd}}</span><img src="../../../../images/icon_202.png"/></p>
						</div>
					</div>
				</div>
			</div>
			<div class="page_cen shadow" v-show="partDatas.length">
				<p class="bg_title nobor">备件列表</p>
				<div class="item_box mt0">
					<div class="item mr" v-for="partData in partDatas">
						<div class="bar">
							<span class="number">
								<img src="../../../../images/icon_204.png" />
								<div class="title-text">{{partData.Part_no}}</div>
							</span>
						</div>
						<div class="text">
							<span class="l">备件名称：</span>
							<span class="cen">{{partData.Part_name}}</span>
						</div>
						<div class="text">
							<span class="l">序列号：</span>
							<span class="cen">{{partData.serial_number}}</span>
						</div>
						<div class="type">
							<p>借货单号：<span>{{partData.Part_DebitNo}}</span></p>
							<p>数量：<span>{{partData.qty}}</span></p>
							<p>单价：<span>{{partData.Price}}</span></p>
							<p>总价：<span>{{partData.TotalPrice}}</span></p>
						</div>
					</div>
				</div>
			</div>
			<div class="page_cen shadow" v-show="isShowInstrumentPart">
				<p class="bg_title nobor">主要备件信息</p>
				<div class="item_box mt0">
					<div class="item mr" v-for="item in instrumentParts">
						<div class="bar">
							<span class="number">{{item.Parts_ID}}<img src="../../../../images/icon_204.png" /></span>
						</div>
						<div class="text">
							<span class="l">备件名称：</span>
							<span class="cen">{{item.Parts_Name}}</span> 
						</div>
						<div class="text">
							<span class="l">备件序列号：</span>
							<span class="cen">{{item.Parts_Serial}}</span> 
						</div>
						<div class="type">
							<p>保修开始时间：<span>{{item.Parts_WarrantyStart}}</span><img src="../../../../images/icon_202.png"/></p>
							<p>保修结束时间：<span>{{item.Parts_WarrantyEnd}}</span><img src="../../../../images/icon_202.png"/></p>
						</div>
					</div>
				</div>
			</div>
			<div style="height: 2px;"></div>
		</div>
		
		
		
		<!-- js代码 start -->

		<!-- 基础js start -->
		<script src="../../../../js/mui.min.js"></script>
		<script src="../../../../js/utils/h.js"></script>
		<script src="../../../../js/constant.js"></script>
		<script src="../../../../js/common.js"></script>
		<script src="../../../../js/utils/base64.js"></script>
		<script src="../../../../js/utils/md5.js"></script>
		<script src="../../../../js/utils/sortMap.js"></script>
		<script src="../../../../js/utils/http.js"></script>
		<script src="../../../../js/utils/vue.min.js"></script>
		<script src="../../../../js/app.js"></script>
		<!-- 基础js end -->

		<script type="text/javascript" charset="utf-8">
			var serviceNo, reportId, reportNo
			
			function getDefaultData() {
				return {
					service_no: '',
					EngRep_ID: '', // 报告号
					primary_contact: '', // 主要联系人
					email_address1: '', // 电子邮件地址1
					emai_address2: '', // 电子邮件地址2
					phone_number: '', // 电话号码
					fax_number: '', // 传真
					Position: '', // 职位
					equipment_model: '', // 仪器型号
					serial_number: '', // 序列号
					USER_ID: '', // 用户号
					Sales_order_number: '', // 销售订单号
					factory_origin: '', // 原产工厂
					equipment_territory: '', // 仪器应用领域
					equipment_type1: '', // 设备类型
					serial_number1: '', // 序列号
					equipment_type2: '', // 设备类型
					serial_number2: '', // 序列号
					equipment_type3: '', // 设备类型
					serial_number3: '', // 序列号
					computer_Mfr: '', // 电脑厂家
					model_number: '', // 电脑型号
					system_software: '', // 系统软件
					software: '', // 操作系统
					option_software: '', // 选项软件
					enginner_name: '', // 工程师姓名
					install_start_time: '', // 安装开始时间
					install_end_time: '', // 安装结束时间
					warranty_start_time: '', // 保修开始时间
					warranty_end_time: '', // 保修结束时间
					Is_arrival_complete: '', // 是否到货完整
					system_quality: '', // 系统质量
					work_time: 0, // 工作小时
					trip_time: 0, // 旅途时间
					waste_time: 0, // 浪费时间
					work_overtime: 0, // 加班时间
					instrumentAssets: [], // 仪器附属设备信息
					instrumentParts: [], // 主要备件信息
					partDatas: [] // 备件信息
				}
			}
			
			var vm = new Vue({
				el: '.mui-content',
				data: getDefaultData(),
				computed: {
					isShowInstrumentAsset: function() {
						return this.instrumentAssets.length > 0
					},
					isShowInstrumentPart: function() {
						return this.instrumentParts.length > 0
					}
				},
				methods: {
					resetData: function() {//重置数据
						Object.assign(this.$data, getDefaultData());
					}
				}
			});
			
			(function($, doc) {
				$.init();

				$.plusReady(function() {
					var self = plus.webview.currentWebview();
					serviceNo = self.serviceNo;
					reportId = self.reportId;
					reportNo = self.reportNo;
					// h('#reportNo').html(reportId)
					initData()
				});
			}(mui, document));
			
			function initData() {
				var enginnerId = app.getUser().enginnerId;
				app.showWaiting()
				ajaxGet(BASE_URL + 'cc/report/preview/installationQualityReport', {
					enginnerId: enginnerId,
					serviceNo: serviceNo,
					reportGuid: reportNo
				}, function(data) {
					app.closeWaiting()
					if (data.code === 200) {
						var ccData = JSON.parse(data.data)
						console.log(ccData.record[0].Part_data)
						if (ccData.status == '1') {
							var record = ccData.record;
							if (record && record.length > 0) {
								var info = record[0];
								// console.log('1111111',info)
								vm.service_no = info.service_no
								vm.EngRep_ID = info.EngRep_ID // 报告号
								
								// 用户联系人信息
								vm.primary_contact = info.primary_contact // 主要联系人
								vm.email_address1 = info.email_address1 // 电子邮件地址1
								vm.emai_address2 = info.emai_address2 // 电子邮件地址2
								vm.phone_number = info.phone_number // 电话号码
								vm.fax_number = info.fax_number // 传真
								vm.Position = info.Position // 职位
								
								// 仪器详细信息
								vm.equipment_model = info.equipment_model // 仪器型号
								vm.serial_number = info.serial_number // 序列号
								vm.USER_ID = info.USER_ID // 用户号
								vm.Sales_order_number = info.Sales_order_number // 销售订单号
								vm.factory_origin = info.factory_origin // 原产工厂
								vm.equipment_territory = info.equipment_territory // 仪器应用领域
								
								// 备件信息
								
								// 其他设备信息
								vm.equipment_type1 = info.equipment_type1 // 设备类型
								vm.serial_number1 = info.serial_number1 // 序列号
								vm.equipment_type2 = info.equipment_type2 // 设备类型
								vm.serial_number2 = info.serial_number2 // 序列号
								vm.equipment_type3 = info.equipment_type3 // 设备类型
								vm.serial_number3 = info.serial_number3 // 序列号
								
								// 计算机和软件信息
								vm.computer_Mfr = info.computer_Mfr // 电脑厂家
								vm.model_number = info.model_number // 电脑型号
								vm.system_software = info.system_software // 系统软件
								vm.software = info.software // 操作系统
								vm.option_software = info.option_software // 选项软件
								
								// 安装工程师信息
								vm.enginner_name = info.enginner_name // 工程师姓名
								vm.install_start_time = info.install_start_time // 安装开始时间
								vm.install_end_time = info.install_end_time // 安装结束时间
								
								// 保修信息
								vm.warranty_start_time = info.warranty_start_time // 保修开始时间
								vm.warranty_end_time = info.warranty_end_time // 保修结束时间
								
								// 系统质量：维修工程师评估
								vm.Is_arrival_complete = info.Is_arrival_complete // 是否到货完整
								vm.system_quality = info.system_quality // 系统质量
								
								// 工时信息
								vm.work_time = info.work_time // 工作小时
								vm.trip_time = info.trip_time // 旅途时间
								vm.waste_time = info.waste_time // 浪费时间
								vm.work_overtime = info.work_overtime // 加班时间
								
								// 仪器附属设备信息
								var instrumentAsset = info.InstrumentAsset;
								if (!JS.IsNullOrEmpty(instrumentAsset)) {
									vm.instrumentAssets = JSON.parse(instrumentAsset)
								}
								// 主要备件信息
								var instrumentPart = info.InstrumentPart;
								if (!JS.IsNullOrEmpty(instrumentPart)) {
									vm.instrumentParts = JSON.parse(instrumentPart)
									console.log(vm.instrumentParts)
								}
								// 备件信息
								var ccPartData = info.Part_data
								if (!JS.IsNullOrEmpty(ccPartData)) {
									vm.partDatas = JSON.parse(ccPartData)
								}
							}
						} else {
							app.toast(ccData.message || '查询失败')
						}
					} else {
						app.toast(data.msg)
					}
				}, function(errorMsg) {
					app.closeWaiting()
					app.toast(errorMsg)
				});
			}
			
		</script>
		<!-- js代码 end -->
	</body>
</html>
